<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <tb-header></tb-header>
      <tb-content></tb-content>
      <tb-footer></tb-footer>
    </div>

    <script src="./lib/Vue3.js"></script>
    <script>
      const { createApp } = Vue;

      // 局部创建组件
      // 只能使用大驼峰
      const TbHeader = {
        template: `
          <header>
            <span>淘宝头部</span>  
          </header>
        `,
      };

      const TbContent = {
        template: `<main>淘宝内容</main>`,
      };

      const TbFooter = {
        template: `<footer>淘宝底部</footer>`,
      };

      // 根组件
      createApp({
        data() {
          return {};
        },
        // 局部创建的组件必须要进行注册(将这个对象变成组件)
        components: {
          TbHeader: TbHeader,
          TbContent,
          TbFooter,
        },
      }).mount("#app");
    </script>
  </body>
</html>
